package com.boot2.core.expiringmap;


/**
 * @param <K> Key type
 * @param <V> Value type
 * @author zhangweilin
 * @date 2019/12/22 20:58
 * Loads entries on demand, with control over each value's expiry duration (i.e. variable expiration).
 * @Description:
 */
public interface ExpiringEntryLoader<K, V> {
    /**
     * Called to load a new value for the {@code key} into an expiring map.
     *
     * @param key to load a value for
     * @return contains new value to load along with its expiry duration
     */
    ExpiringValue<V> load(K key);
}